﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MES_SystemUI.UI.GlobalSet
{
    public partial class FontForm : Form
    {
        Font globalfont = MainForm.SystemDataConfig.GlobalFont;
        public FontForm()
        {
            InitializeComponent();
            button1.Click += Button1_Click;
            button2.Click += Button2_Click;
            button3.Click += Button3_Click;
            bingdata();
        }

        private void bingdata()
        {
            textBox1.Text = globalfont.Name;
            textBox2.Text = globalfont.Size.ToString();
        }

        // 取消
        private void Button3_Click(object sender, EventArgs e)
        {
            globalfont = MainForm.SystemDataConfig.GlobalFont;
            bingdata();
        }
        // 确定
        private void Button2_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            FontDialog dlg = new FontDialog();
            if(dlg.ShowDialog() == DialogResult.OK)
            {
                globalfont = dlg.Font;
                bingdata();
            }
        }
    }
}
